package com.atguigu.gmall.weball.controller;

import com.atguigu.gmall.feign.order.OrderFeignClient;
import com.atguigu.gmall.model.order.entity.OrderInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @Author:lyd
 **/
@Controller
public class PaymentController {
    @Autowired
    OrderFeignClient orderFeignClient;

    @GetMapping("pay.html")
    public String pay(@RequestParam("orderId") Long orderId, Model model) {
        //远程获取订单确认数据
        OrderInfo data = orderFeignClient.getOrderInfoById(orderId).getData();
        model.addAttribute("orderInfo", data);
        return "payment/pay";
    }
    @GetMapping("success.html")
    public String paySuccess(){

        return "payment/success";
    }
}
